<html
    xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"
    xmlns:core="http://typo3.org/ns/TYPO3/CMS/Core/ViewHelpers"
    xmlns:be="http://typo3.org/ns/TYPO3/CMS/Backend/ViewHelpers"
    data-namespace-typo3-fluid="true">

<f:layout name="Default" />

<f:section name="Buttons">
    <be:moduleLayout.button.linkButton
        icon="actions-add"
        title="{f:translate(id: 'LLL:EXT:backend/Resources/Private/Language/locallang_layout.xlf:newRecordGeneral')}"
        link="{be:uri.newRecord(table: 'be_users')}"
    />
</f:section>

<f:section name="Content">
    <h1><f:translate key="backendUserListing" /></h1>
    <f:comment>
        Listing of users on compare list
    </f:comment>
    <f:if condition="{compareUserList}">
        <h3>{f:translate(key: 'section.compare', default: 'Compare')}</h3>
        <div class="table-fit">
            <table id="typo3-backend-user-list-compare" class="table table-hover">
                <tbody>
                    <f:for each="{compareUserList}" as="compareUser">
                        <tr>
                            <td>
                                <a href="#" class="t3js-contextmenutrigger" data-table="be_users" data-uid="{compareUser.uid}" title="id={compareUser.uid}">
                                    <be:avatar backendUser="{compareUser.uid}" showIcon="TRUE" />
                                </a>
                            </td>
                            <td class="col-title">
                                <be:link.editRecord table="be_users" uid="{compareUser.uid}" title="edit">
                                    <b>{compareUser.username}</b>
                                </be:link.editRecord>
                                <f:if condition="{onlineBackendUsers.{compareUser.uid}}">
                                    <span class="label label-success"><f:translate key="online" /></span>
                                </f:if>
                                <br />
                                <f:if condition="{compareUser.realName}">
                                    <be:link.editRecord table="be_users" uid="{compareUser.uid}" title="edit">
                                        {compareUser.realName}
                                    </be:link.editRecord>
                                </f:if>
                            </td>
                            <td class="col-control">
                                <div class="btn-group" role="group">
                                    <be:link.editRecord class="btn btn-default" table="be_users" uid="{compareUser.uid}" title="{f:translate(key:'edit')}">
                                        <core:icon identifier="actions-open" />
                                    </be:link.editRecord>
                                </div>
                                <div class="btn-group" role="group">
                                    <f:link.action action="removeFromCompareList" arguments="{uid: compareUser.uid}" class="btn btn-default" title="{f:translate(key: 'remove')}">
                                        <core:icon identifier="actions-remove" />
                                    </f:link.action>
                                </div>
                            </td>
                        </tr>
                    </f:for>
                </tbody>
            </table>
        </div>
        <f:link.action action="compare" title="{f:translate(key: 'compareUserList', default: 'Compare user list')}" class="compare btn btn-default">{f:translate(key: 'compareUserList', default: 'Compare user list')}</f:link.action>
        <f:link.action action="removeAllFromCompareList" class="btn btn-default"><core:icon identifier="actions-selection-delete" /> {f:translate(key: 'clearCompareList')}</f:link.action>
        <hr>
    </f:if>

    <f:render partial="Filters/BackendUser/Index" arguments="{demand: demand, backendUserGroups: backendUserGroups}" />

    <f:render partial="BackendUser/PaginatedListWidget" arguments="{_all}" />

</f:section>

</html>
